#if !defined(SM__COLLIDE_H)
#define SM__COLLIDE_H

#include "SDL.h"
#include "swagme.h"

class TouchableObject;

struct CollisionMap 
{
  // this becomes an array of pointers
  TouchableObject** map;
  unsigned int height;
  unsigned int width;
  unsigned int cellInPixels;

  void addTouchableObject(TouchableObject*);
  void removeTouchableObject(TouchableObject*);
};

struct CollisionEvent {
  sm_cdr_result result;
  TouchableObject* cdrObject;
  unsigned char cdrObjectType;
  Sint16 finalX, finalY;
};

// used references instead of pointers to prevent any memory leaks
// and ownership questions...
void moveRectWithCdr(const CollisionMap& colMap,
                     const SDL_Rect& inPosBegin,
                     const SDL_Rect& inPosEnd,
                     CollisionEvent& outEvent);

#endif // SM__COLLIDE_H
